package cn.yuan.xiaoyu.testmodule.bean;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by yukuoyuan on 2017/4/10.
 */

public class TestBean implements Parcelable {
    public int age;
    public String name;
    public String phone;
    public String email;

    @Override
    public String toString() {
        return "TestBean{" +
                "age=" + age +
                ", name='" + name + '\'' +
                ", phone='" + phone + '\'' +
                ", email='" + email + '\'' +
                '}';
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.age);
        dest.writeString(this.name);
        dest.writeString(this.phone);
        dest.writeString(this.email);
    }

    public TestBean() {
    }

    protected TestBean(Parcel in) {
        this.age = in.readInt();
        this.name = in.readString();
        this.phone = in.readString();
        this.email = in.readString();
    }

    public static final Parcelable.Creator<TestBean> CREATOR = new Parcelable.Creator<TestBean>() {
        @Override
        public TestBean createFromParcel(Parcel source) {
            return new TestBean(source);
        }

        @Override
        public TestBean[] newArray(int size) {
            return new TestBean[size];
        }
    };
}
